import java.util.Scanner;

/**
 * @author gao
 * @date 2025/6/19 19:28
 */

public class Solution {
    public String removeDuplicates(String s) {
        StringBuffer ret = new StringBuffer();
        char[] ch = s.toCharArray();
        for (char i : ch) {
            // 如果ret的长度大于0且当前字符与ret的最后一个字符相等，则删除ret的最后一个字符
            if (ret.length() > 0 && i == ret.charAt(ret.length() - 1)) {
                ret.deleteCharAt(ret.length() - 1);
                // 否则，将当前字符添加到ret中
            } else {
                ret.append(i);
            }
        }
        return ret.toString();
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String s = scanner.nextLine();
            Solution solution = new Solution();
            System.out.println(solution.removeDuplicates(s));
        }
    }
}